package com.seckill.dto;

/**
 * 暴露秒杀接口地址DTO
 */
public class Exposer {
	// 是否暴露
	private boolean exposed;

	// MD5一种加密措施 用于加密
	private String md5;

	private Long seckillId;

	// 系统当前时间
	private Long now;

	private Long start;

	private Long end;

	/**
	 * 成功构造
	 * @param exposed
	 * @param md5
	 * @param seckillId
	 */
	public Exposer(boolean exposed, String md5, Long seckillId) {
		this.exposed = exposed;
		this.md5 = md5;
		this.seckillId = seckillId;
	}

	/**
	 * 失败构造 返回当前时间、系统时间、结束时间
	 * @param exposed
	 * @param seckillId
	 * @param now
	 * @param start
	 * @param end
	 */
	public Exposer(boolean exposed, Long seckillId, Long now, Long start, Long end) {
		this.exposed = exposed;
		this.seckillId = seckillId;
		this.now = now;
		this.start = start;
		this.end = end;
	}

	/**
	 * 构造失败，秒杀商品不存在
	 * @param exposed
	 * @param seckillId
	 */
	public Exposer(boolean exposed, Long seckillId) {
		this.exposed = exposed;
		this.seckillId = seckillId;
	}

	public boolean isExposed() {
		return exposed;
	}

	public void setExposed(boolean exposed) {
		this.exposed = exposed;
	}

	public String getMd5() {
		return md5;
	}

	public void setMd5(String md5) {
		this.md5 = md5;
	}

	public Long getSeckillId() {
		return seckillId;
	}

	public void setSeckillId(Long seckillId) {
		this.seckillId = seckillId;
	}

	public Long getNow() {
		return now;
	}

	public void setNow(Long now) {
		this.now = now;
	}

	public Long getStart() {
		return start;
	}

	public void setStart(Long start) {
		this.start = start;
	}

	public Long getEnd() {
		return end;
	}

	public void setEnd(Long end) {
		this.end = end;
	}

	@Override
	public String toString() {
		return "Exposer [exposed=" + exposed + ", md5=" + md5 + ", seckillId=" + seckillId + ", now=" + now + ", start="
				+ start + ", end=" + end + "]";
	}

}
